<?php

namespace app\data\model;

use think\admin\Model;
class DataWechat extends Model
{
    public static function info($where=[],$field='*',$order=[]):array{
        $info = self::mk()->where($where)->field($field)->order($order)->findOrEmpty();
        if($info->isEmpty()){
            return [];
        }
        return $info->toArray();
    }
    public static function lists($where=[],$field='*',$order=[],$limit=[0,50]):array{
        $info = self::mk()->where($where)->field($field)->order($order)->limit($limit[0],$limit[1])->select();
        if($info->isEmpty()){
            return [];
        }
        return $info->toArray();
    }
    public static function updateInfo($where=[],$data=[]) :bool{
        return self::mk()->update($data,$where);
    }
}
